package list;

import java.util.List;
import java.util.ArrayList;

public class SubListTest {

    public static void main(String[] args) {

        List<String> staff = new ArrayList<>();

        staff.add("Tom");
        staff.add("Andy");
        staff.add("Lily");
        staff.add("Hello");
        staff.add("World");

        List<String> group = staff.subList(1, 3);
        group.clear();

        for (String element : staff) {
            System.out.println(element);
        }
    }
}
